
use tokio::time;

fn main() {
    foo();
    println!("main run");
}

fn foo() {
    let runtime = tokio::runtime::Builder::new_current_thread()
        .enable_all()
        .build()
        .unwrap();

    runtime.block_on(async {
        foo2().await;
    });
}

async fn foo2() {
    println!("async foo2 run");
    time::sleep(time::Duration::from_secs(1)).await;
    println!("async foo2 end");
}